.docs-navigation {
  display: flex;
  margin-top: -15px;
  margin-bottom: 6rem;
  border-bottom: 1px solid @black-10;

  a {
    padding: 0 10px 16px;
    font-size: 16px;
    color: @black-70;

    &.active {
      color: @blue;
      border-bottom: 2px solid @blue;
    }

    &:hover {
      border-bottom: 2px solid @black-40;
    }

    &:first-child {
      padding-left: 0;
    }
  }

  & ~ .page-header-title h1 {
    color: @navy-darker;
  }

  &.v2 {
    margin-bottom: 32px;
    position: relative;

    @media (max-width: 1100px) {
      margin-bottom: 56px;
    }
  }
}

.edit-this-page {
  position: absolute;
  right: 0;

  &.v2 {
    a {
      color: rgba(0, 0, 0, 0.35);
      padding: 0;
      border-bottom: none;
      font-weight: 500;

      &:hover {
        color: rgba(0, 0, 0, 0.5);
      }
    }
  }

  @media (max-width: 1100px) {
    top: 135px;
    left: 0px;
  }
  @media (max-width: 400px) {
    left: 20px;
  }
}

#documentation {
  .content {
    ol {
      padding-left: 2rem;
    }

    ul {
      // avoid nested lists and lists elements to have smaller and smaller
      // font sizes
      font-size: inherit;

      li {
        // avoid ridiculously big spaces between lists elements
        margin-bottom: 0.2rem;
      }

      ul {
        // avoid nested lists to have too much margin
        margin-left: 1.3rem;
        margin-top: 0.3rem;
        margin-bottom: 0.3rem;
      }
    }

    .indent {
      margin-left: 2rem;
    }

    table.indent {
      width: -moz-available;
      width: -webkit-fill-available;
      width: fill-available;
    }

    // titles proportions overridden from base.less

    h2 {
      margin-top: 3rem;
      margin-bottom: 1rem;
      font-size: 3.5rem;
      font-weight: 400;
    }

    h3 {
      font-size: 2.5rem;
      font-weight: 300;
    }

    h4 {
      font-size: 2.2rem;
      font-weight: 300;
    }

    h5 {
      font-size: 1.6rem;
      font-weight: 300;
    }

    h6 {
      font-size: 1.2rem;
      font-weight: 200;
    }
  }

  &.v2 {
    .docs-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;

      .docs-grid-section-title {
        margin: 8px 0 8px;
        font-size: 28px;
        font-weight: lighter;
        font-family: Roboto, -apple-system, system-ui, BlinkMacSystemFont,
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        color: rgba(0, 0, 0, 0.7);
        grid-column: 1 / span 2;

        &:not(:first-of-type) {
          margin-top: 40px;
        }
      }

      a {
        color: @blue;
      }

      .docs-grid-block {
        float: none;
        width: auto;
        height: auto;
        margin-top: 16px;
        border-bottom: 1px solid #eee;
        padding: 24px 32px 24px 0;

        h3 {
          font-size: 24px !important;
        }
      }

      @media (max-width: 1200px) {
        grid-template-columns: 1fr;

        .docs-grid-section-title {
          grid-column: 1;
        }
      }
    }
  }
}

#getkong-algolia-search {
  input {
    vertical-align: inherit !important;
    height: 40px;
    margin-bottom: 0;
  }

  float: right;
  margin-left: 10px;
  /* auto complete */

  .algolia-autocomplete {
    width: 220px;
  }

  /* Bottom border of each suggestion */

  .algolia-docsearch-suggestion {
    border-bottom-color: @blue-light;
  }

  /* Highlighted search terms */

  .algolia-docsearch-suggestion--highlight {
    color: @blue-light;
  }

  /* Currently selected suggestion */

  .aa-cursor .algolia-docsearch-suggestion--content {
    color: @blue-light;
  }

  &.v2 {
    margin-left: 0;
    float: none;

    .algolia-autocomplete {
      width: 450px;

      @media (max-width: @navbar-collapse-point) {
        width: 250px;
      }
    }

    &.small {
      .algolia-autocomplete {
        width: 150px;
      }
    }
  }

  @media (max-width: @navbar-collapse-point) {
    float: initial;
    display: inline-block;
    margin-right: 5px;
    .algolia-docsearch-suggestion--subcategory-column {
      display: none !important;
    }
  }
  @media (max-width: 476px) {
    margin: 10px 0 0;
    float: left;
    clear: both;
  }
}

.search-input {
  i,
  .icon {
    position: absolute;
    z-index: 1;
    padding: 11px 0 0 12px;
  }

  .icon {
    width: 16px;
    height: 16px;
    padding-top: 13px;
  }

  input {
    width: 100%;
    padding-left: 34px;
  }

  &.v2 {
    input {
      border-top-left-radius: 0;
      border-bottom-left-radius: 0;
    }
  }
}

.search-version-row {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

.docs-sidebar {
  float: left;
  width: 285px;
  position: sticky;
  top: 56px;
  height: ~"calc(100vh - 56px)";
  border-right: 1px solid @gray;
  overflow-y: auto;

  &::-webkit-scrollbar {
    width: 2px;
  }

  &::-webkit-scrollbar-thumb {
    background-color: #b3dfff;
    outline: 1px solid #b3dfff;
  }

  ul.items {
    margin: 0;
    padding: 16px 0;

    li {
      list-style: none;
      margin: 0;

      ul {
        margin: 0;
      }

      a {
        font-size: 16px;
        line-height: 34px;
        color: rgba(0, 0, 0, 0.45);

        &.active {
          color: #4c4c4c;
          font-weight: bold;
        }
      }
    }
  }

  @media (max-width: 800px) {
    position: fixed;
    top: 56px;
    left: 0;
    padding: 0;
    height: ~"calc(100% - 56px)";
    box-shadow: 0px 12px 15px rgba(0, 0, 0, 0.15);
    border: 0 none;
    background: #fff;
    overflow-y: auto;
    z-index: 100;
    transform: translateX(-100%);
    -webkit-transform: translateX(-100%);
    transition: all 300ms ease-in-out;

    &.sidebar-open {
      transform: translateX(0);
    }
  }
}

.knowledge-base-section {
  margin-top: 32px;

  .knowledge-base-section-title {
    text-align: center;
    font-size: 28px;
    font-family: Roboto, -apple-system, system-ui, BlinkMacSystemFont,
      "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: lighter;
  }

  .knowledge-base-links {
    display: flex;
    justify-content: center;
    margin-top: 24px;

    .knowledge-base-link {
      margin: 0 80px 32px;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-decoration: none;

      .knowledge-base-link-title {
        text-align: center;
        color: @blue;
        font-size: 16px;
        font-weight: 600;
        white-space: nowrap;
        text-decoration: none;
      }

      img {
        margin-top: 16px;
      }
    }

    @media (max-width: 1100px) {
      flex-direction: column;
    }
  }
}

.docs-toc {
  float: right;
  width: 300px;
  padding: 32px 16px;
  position: sticky;
  top: 56px;
  height: ~"calc(100vh - 120px)";
  overflow-y: auto;

  .docs-toc-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
  }

  ul {
    margin: 0 0 0 8px;
    padding: 0;
    list-style: none;

    li {
      margin: 0;

      a {
        img {
          display: none;
        }

        font-size: 16px;
        line-height: 33px;
        color: rgba(0, 0, 0, 0.8);
        opacity: 0.6;
        transition: opacity 0.2s;

        &:hover {
          opacity: 1;
        }

        &.active {
          font-weight: 600;
          opacity: 1;
        }
      }
    }
  }

  > ul {
    margin-left: 0;
  }

  @media screen and (max-width: 1080px) {
    display: none;
  }
}
